#include "struct.h"

int left_turn(const point& a, const point& b, const point& c)
{
	const double eps = 4 * std::numeric_limits<double>::epsilon();
	double part1 = (b.x - a.x) * (c.y - a.y);
	double part2 = (b.y - a.y) * (c.x - a.x);
    double left_turn = part1 - part2;

    if (eps * (std::abs(part1) + std::abs(part2)) < left_turn)
        return 1;
    if (eps * (std::abs(part1) + std::abs(part2)) <= -left_turn)
        return -1;
    return 0;													//maybe not enough accuracy
}